<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>

 <script type="text/javascript">
 jQuery.ajax({
		type:"POST",
	 	url:"${ctx}/user/getUser", 
	 	data:"",
		dataType:"json",
		success:function(data){
			 var nickName = data.nickName;
				if( typeof(nickName) != "undefined" &&  nickName != ""){
					$("#userDiv").append("<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>"+nickName+" <span class='caret'></span></a><ul class='dropdown-menu' role='menu'><li><a href='${ctx}/blog/blogInit'>个人空间</a></li><li><a href='${ctx}/user/updUserForSapce'>空间管理</a></li><li><a href='${ctx}/log/logout'>退出</a></li></ul></li>");
				}else{
				//	$("#userDiv").append("<li><a href='${ctx}/goto/gotoPage?page=login'>登录</a></li>");
					$("#userDiv").append("<li><a href='${ctx}/goto/gotoPage?page=login'>登录</a></li><li><a href='${ctx}/goto/gotoPage?page=reg'>注册</a></li>");
				}

			}
	 	});
</script>
	<nav class="navbar navbar-default" role="navigation"
		style="margin-bottom: 0px;">
		<div class="container-fluid">
			<!-- Brand and toggle get grouped for better mobile display -->

			<div class="navbar-header" >
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="http://www.begincode.net"><img alt="初学者论坛" src="${ctx}/images/navlogo.gif" style="height:30px;"></a>
			</div>

			<!-- Collect the nav links, forms, and other content for toggling -->
			<div class="collapse navbar-collapse"
				id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">
					<li class=""><a href="http://www.begincode.net">首页</a></li>
					<li class="dropdown">
					<a href="#" class="dropdown-toggle"	data-toggle="dropdown">基础教程<span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="${ctx}/course/viewChapterByCourse/1.html">JAVA-Web开发</a></li>
							<li><a href="${ctx}/course/viewChapterByCourse/3.html">SQL基础</a></li>
							<li><a href="${ctx}/course/viewChapterByCourse/2.html">MySQL数据库</a></li>
						</ul></li>
					<li class="dropdown">
					<a href="#" class="dropdown-toggle"	data-toggle="dropdown">代码分享<span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="${ctx}/code/codeList/4.html">JavaWeb代码</a></li>
							<!-- <li><a href="#">Php方向</a></li>
							<li><a href="#">.Net</a></li>
							 -->
						</ul></li>
					<li class="dropdown">
					<a href="#" class="dropdown-toggle"	data-toggle="dropdown">资源管理<span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="${ctx}/down/downList/12.html">开发工具</a></li>
							<li><a href="${ctx}/down/downList/13.html">学习资源</a></li>
							<li><a href="${ctx}/down/downList/14.html">常用组件、框架</a></li>
							<!-- <li><a href="#">Oracle数据库</a></li>
							 -->
						</ul></li>
					<li class="dropdown">
					<a href="#" class="dropdown-toggle"	data-toggle="dropdown">实战项目<span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="${ctx}/project/viewProject/1.html">BeginCode开发过程</a></li>
						</ul></li>
						<li class="dropdown">
					<li class=""><a href="${ctx}/goto/gotoPage?page=contribution"><font color="red">贡献榜</font></a></li>
						</li>
				</ul>
				
				 <ul class="nav navbar-nav navbar-right" id="userDiv">
				 
     
				<form class="navbar-form navbar-right" role="search" style="margin-right:100px;">
					<div class="form-group">
						<input type="text" name="" class="form-control "
							placeholder="教程，资源">
					</div>
					<button type="submit" class="btn btn-primary">站内搜索</button>
				</form>
				 </ul>
			</div>
			<!-- /.navbar-collapse -->
		</div>
		<!-- /.container-fluid -->
	</nav>
 
